<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
			<ul class="breadcrumb">
				<li><a  href="<{:addons_url('index')}>">表模型</a> </li>
				<li class="active">添加</li>
			</ul>
		</div>
		<div class="panel-body">
			<form id="myform" method="post" class="form-horizontal" action="<{:addons_url('add')}>">
				<input type="hidden" name="id" value="<{$data.id}>">
				 
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">表名</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="table_name" name="table_name" value="<{$data.table_name}>">
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">调用名称</label>
					<div class="col-sm-7">
						<input  type="text" placeholder="默认为表名" class="form-control"  id="name" name="name" value="<{$data.name}>">
					</div>
				</div>
				
				 
				 
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">备注</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="des" name="des" value="<{$data.des}>">
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">标题</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="title" name="title" value="<{$data.title}>">
					</div>
				</div>
				 

				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">删除前勾子</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="name" name="hook_before_del" value="<{$data.hook_before_del}>">
					</div>
				</div>
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">删除后勾子</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="name" name="hook_after_del" value="<{$data.hook_after_del}>">
					</div>
				</div>
				
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">添加前勾子</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="name" name="hook_before_add" value="<{$data.hook_before_add}>">
					</div>
				</div>
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">添加后勾子</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="name" name="hook_after_add" value="<{$data.hook_before_del}>">
					</div>
				</div>
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">列表显示条数</label>
					<div class="col-sm-7">
						<input  type="text" class="form-control"  id="name" name="_limit" value="<{$data._limit}>">
					</div>
				</div>
				
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">列表查询条件</label>
					<div class="col-sm-7">
						<textarea class="form-control" placeholder=""  name="_where"><{$data._where}></textarea>
					</div>
				</div>

				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">显示添加按钮</label>
					<div class="col-sm-7">
						<{:form_radio('_showBtn',array('1'=>'显示',2=>'不显示'),$data['_showBtn'])}>
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">按钮</label>
					<div class="col-sm-7">
						<textarea class="form-control" placeholder=""  name="_showBtnHtml"><{$data._showBtnHtml}></textarea>
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">列表排序</label>
					<div class="col-sm-7">
					<input  type="text" class="form-control"  id="name" name="_order_by" value="<{$data._order_by}>">
						
					</div>
				</div>
				
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">url参数</label>
					<div class="col-sm-7">
					<input  type="text" placeholder="如：group_name,auto_complete_name" class="form-control"  id="name" name="params" value="<{:$data['params']?$data['params']:'auto_complete_name'}>">
						
					</div>
				</div>
				
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">列表显示搜索</label>
					<div class="col-sm-7">
					<{:form_radio('_search',array('1'=>'显示',2=>'不显示'),$data['_search'])}>	
					</div>
				</div> 
				
				
				
				<if condition="$data['name']">
				<div class="form-group">
					<label for="input-title"  class="col-sm-2 control-label">列表搜索表单</label>
					<div class="col-sm-7">
						<a data-type="modal" class="btn btn-primary btn-xs" href="/BoxAddon/Forms/Index/fields/group_name/search_<{$data.name}>">设置</a>
					</div>
				</div>
			</if>
				
				
				 
				
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-7">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            table_name: {
                message: '表名',
                validators: {
                    notEmpty: {
                        message: '表名不能为空'
                    },
                }
            },
			
			title: {
                message: '标题',
                validators: {
                    notEmpty: {
                        message: '标题不能为空'
                    },
                }
            },
			
			
			
        }
    });
	
 
});
 </script> 